package modele.WorldElem;

import java.awt.Color;
import java.util.Random;

import modele.Square;
import modele.World;

import controller.Rule;
import controller.Visitor;
import controller.VisitorDraw;

public class Earth extends State{
	public final static int TOGRASS = 200;
	
	public Earth(){
		super();
		
	}
	
	public Earth(SecondaryState ss){
		super(ss);
	}

	@Override
	public void accept(Visitor v) {
		v.visit(this);
		
	}

	@Override
	public void evolve(Square s, World w) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int getState() {
		return State.EARTH;
	}

	@Override
	public int getStateAdditionalAltitude() {
		return 0;
	}

	@Override
	public Color getColor(Square s) {
		if(this.getSecondaryStateValue()!= SecondaryState.NONE) return this.getSecondaryState().getColor(s);
		return new Color(139,(int)(69.0f+s.getAltitude())/2,19);
	}

	@Override
	public void applyRule(Rule r, Square s, World w) {
		r.applyRule(this, s);
	}

	@Override
	public Object clone() {
		return new Earth((SecondaryState)getSecondaryState().clone());
	}




}
